package model
{
	import ilog.calendar.CalendarItem;
	
	[RemoteClass(alias="model.Seance")]
	[Bindable] 
	public class Seance
	{
		private var m_id_seance		:Number;
		private var m_debut			:int;
		private var m_fin			:int;
		private var m_id_salle		:Number;
		private var m_id_jour		:Number;
		private var m_id_service	:Number;
		private var m_aSalle		:Salle;
		private var m_aJour			:Jour;
		private var m_aService		:Service;
		private var m_collSuivres	:Array;
		private var m_id_an_etude	:int;
		private var m_aAnneeEtude	:AnneeEtude;
		
		public function Seance()
		{
			
		}
		
		public function get id_seance():Number{
			return m_id_seance;
		}
		
		public function set id_seance(value:Number):void{
			m_id_seance = value;
		}
		
		public function get debut():int{
			return m_debut;
		}
		
		public function set debut(value:int):void{
			m_debut = value;
		}
		
		public function get fin():int{
			return m_fin;
		}
		
		public function set fin(value:int):void{
			m_fin = value;
		}
		
		public function get id_salle():Number{
			return m_id_salle;
		}
		
		public function set id_salle(value:Number):void{
			m_id_salle = value;
		}
		
		public function get id_jour():Number{
			return m_id_jour;
		}
		
		public function set id_jour(value:Number):void{
			m_id_jour = value;
		}
		
		public function get id_service():Number{
			return m_id_service;
		}
		
		public function set id_service(value:Number):void{
			m_id_service = value;
		}
		
		public function get id_an_etude():Number{
			return m_id_an_etude;
		}
		
		public function set id_an_etude(value:Number):void{
			m_id_an_etude = value;
		}
		
		public function get aSalle():Salle{
			return m_aSalle;
		}
		
		public function set aSalle(value:Salle):void{
			m_aSalle = value;
		}
		
		public function get aJour():Jour{
			return m_aJour;
		}
		
		public function set aJour(value:Jour):void{
			m_aJour = value;
		}
		
		public function get aService():Service{
			return m_aService;
		}
		
		public function set aService(value:Service):void{
			m_aService = value;
		}

		public function get aAnneeEtude():AnneeEtude{
			return m_aAnneeEtude;
		}
		
		public function set aAnneeEtude(value:AnneeEtude):void{
			m_aAnneeEtude = value;
		}
				
		public function get collSuivres():Array{
			return m_collSuivres;
		}
		
		public function set collSuivres(value:Array):void{
			m_collSuivres = value;
		}
		
		
		/** ILOG **/
		public function set startTime(value:Date):void
		{
			m_debut = value.time / 1000;
		}
		
		public function get startTime():Date
		{
			return new Date(m_debut * 1000);
		}

		public function set endTime(value:Date):void
		{
			m_fin = value.time / 1000;
		}
		
		public function get endTime():Date
		{
			return new Date(m_fin * 1000);
		}
		
		public function get summary():String
		{
			var output:String = "";
			
			if(aService != null)
			{
				output += aService.aEnseignement.aMatiere.nom;
				output += "\n"+aService.aEnseignant.toString();
			}
			
			if(aSalle != null)
			{
				output += "\n"+aSalle.nom;
			}
			
			return output;
		}
		
		public function get color():uint
		{
			var couleur:uint
			try
			{
				couleur = parseInt((aService.aEnseignement.aMatiere.collRelevers[0] as Relever).aUe.couleur);
			}
			catch(e:Error)
			{ 
				couleur = 0x004400;
			}
			
			return couleur;
		}
		
		public function get description():String
		{
			return "Desc description";
		}
	}

}